<template>
    <div>
        欢迎进入主页
        <div class="menu">
            <el-row :gutter="20">
                <el-col :span="6" v-for="(item, index)  in list" :key="index">
                    <div class="grid-content ep-bg-purple">
                        <router-link :to="'/main/' + item.path">
                            {{ item.msg }}
                        </router-link>
                    </div>
                </el-col>
            </el-row>
        </div>
        <RouterView></RouterView>
    </div>
</template>
<script lang='ts' setup>
import { ref } from "vue";
let list: any = ref([]);
//获取localStorage存储的menu信息
let menu = localStorage.getItem("menu");
if (menu) {
    list.value = JSON.parse(menu)
}
</script>
<style lang='less' scoped>
.menu {
    height: 20px;
    text-align: center;
    overflow: hidden;
}

.el-row {
    margin-bottom: 20px;
}

.el-row:last-child {
    margin-bottom: 0;
}

.el-col {
    border-radius: 4px;
}

.grid-content {
    border-radius: 4px;
}
</style>